#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <map>
#include <unordered_map>

using ll = long long;
using namespace std;

// p/q
struct fraction{
    ll p,q;
    fraction(ll P = 0, ll Q = 1): p(P), q(Q){}
    bool operator<(const fraction &other)const{
        return p*other.q < other.p*q;
    }
    bool operator<=(const fraction &other)const{
        return p*other.q <= other.p*q;
    }
};
int main(){
    int N; cin >> N;
    vector<ll> x(N),y(N);
    for(int i=0; i<N; i++) cin >> x[i] >> y[i];
    vector<pair<fraction,fraction> > data(N);
    for(int i=0; i<N; i++) data[i] = make_pair(fraction(y[i],x[i]-1),fraction(y[i]-1,x[i]));
    sort(data.begin(),data.end());
    int ans = 0;
    fraction now;
    for(auto p: data){
        if(now <= p.second){
            ans++;
            now = p.first;
        }
    }
    cout << ans << endl;
}